<?php

/*
=====================================================
 Generic Toolbox - by Carl Wells
-----------------------------------------------------
-----------------------------------------------------
 Copyright (c) 2009 Carl Wells
=====================================================
 THIS IS COPYRIGHTED SOFTWARE
 PLEASE READ THE LICENSE AGREEMENT
=====================================================
 File: system/display/admindisplay.class.php
-----------------------------------------------------
 Purpose: This file builds all visual aspects of the Admin Section.
 All browser output is managed by this file.
=====================================================
*/
class Groupdisplay extends Genericdisplay
{

var $sectors;


	function display_header(){
	
		$header = "<div id=\"topsection\"><div class=\"innertube\">";
		
		// GET INFO FROM DATABASE
		
		$header .= "<h1>".SITENAME." Admin</h1>";
		
		$header .= "</div></div>";
		
        return $header;
        
        }
        
   
  	
  	// Display the main navigation for the Control Panel
  	// TO BE PULLED FROM A DB LATER A POSSIBILITY
	function display_main_admin_nav(){
	
		$nav = "";
		$nav .="<ul>\n";
		$nav .="<li><a href=\"index.php?act=sections\">Sections</a></li>\n";
		$nav .="<li><a href=\"index.php?act=promos&sector=1\">Promotions</a></li>\n";
		$nav .="<li><a href=\"index.php?act=pos\">Add POS Item</a></li>\n";
		$nav .="<li><a href=\"users.php\">Users</a></li>\n";
		$nav .="</ul>\n";
		
		return $nav;
	
	}
	
	function display_main_group_nav(){
	
		$nav = "";
		$nav .="<ul>\n";
		$nav .="<li><a href=\"addgroup.php\">Add Group</a></li>\n";
		$nav .="<li><a href=\"deletegroup.php\">Delete Group</a></li>\n";
		$nav .="</ul>\n";
		
		return $nav;
	
	}
	
	
	
	function displayUsersForGroup(){
		$html = "";
		$html .= "<div id=\"wrapper\">";
		$html .= "<div class=\"form-container\">";
		$html .= "<form action=\"finduser.php\" method=\"post\"  enctype=\"multipart/form-data\" >";
		$html .= "<p class=\"legend\"><strong>Note:</strong> Required fields are marked with an asterisk (<em>*</em>)</p>";
		$html .= "<fieldset>";
		$html .= "<legend>Find User</legend>";
		$html .= "<div><label for=\"unitnumber\">Unit Number</label> <input id=\"unitnumber\" type=\"text\" name=\"unitnumber\" value=\"\"/></div>";
		$html .= "</fieldset>";
		$html .= "<div class=\"buttonrow\">";
		$html .= "<input type=\"submit\" value=\"Find\" class=\"button\" />";
		$html .= "</div>";
		$html .= "</form>";
		$html .= "</div>";
		$html .= "</div>";
		
		
		return $html;
	}
	
	function displayGroupSelect($sector){
		require_once( SITEBASE."/system/db/dbGroup.class.php" );
		$DB = new DbGroup();
		
		$sql = "Select * FROM `categories_group` WHERE `sector` = '".$sector."';";
		
	//	$html .= "<ul>";
		$html .= "<select name=\"groups\" size=\"\" id=\"groups\">";
		
		$result = $DB->selectQuery($sql);
		while ($categories = mysql_fetch_array($result)){
			$html .= "<option onclick=\"getUsers(".$categories['id'].");\">".$categories['nameOfGroup']."</option>";
		}
		$html .= "</select>";
		
		return $html;
		
		}
	


}

?>